package com.system.controller;

import com.system.feign.TestFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/system")
public class DemoController {

    @Autowired
    RestTemplate restTemplate;

    @Autowired
    TestFeign testFeign;

    @RequestMapping("/test")
    public String test(){
        String s = "123465";
//        s = restTemplate.getForObject("http://getway/test/test",String.class);
//        System.out.println(s);
        return s;
    }

    @RequestMapping("/test1")
    public String test1(){
        String test = testFeign.test();
        System.out.println(test);
        return test;
    }
}
